import { getChannelApi } from '@/apis/article'
import { useState, useEffect } from 'react'

function useChannel() {
    const [channels, setChannels] = useState([])

    useEffect(() => {
        getChannelApi()
            .then(res => {
                console.log('hook', res)
                setChannels(res.data.channels)
            })
    }, [])

    return { channels }
}

export { useChannel }